<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p3_CSS常用值</title>
    <style>
        h1 {
            color: red;
            color: rgb(255, 0, 0);
            color: rgb(0, 255, 0);
            color: rgb(0, 0, 255);
            color: #ff0000;
            color: #0f0;
            color: #00f;
            color: rgba(255,0,0,0.7);
            color: rgba(255,0,0,.5);
            color: rgba(255,0,0,.3);
            color: rgba(255,0,0,.1);
            color: rgba(255,0,0,0);
            color: rgba(255,0,0,1);
        }
        /*块级元素默认宽度为父级宽度的100% 高度为0靠内容撑起来*/
        .d1 {
            /*注意:插入背景图必须设置所在区域的大小!*/
            width: 50px;
            height: 100px;
            /*插入背景图*/
            background-image: url(img/mr.png);
            /*调整背景图尺寸:宽度 高度*/
            background-size: 50px 100px;
            /* 可以同时设置背景色 没有图的地方显示背景色 */
            background-color: cyan;
        }
        .d2{
            /*  500*300 5像素的红色边框 插入鸣人背景图 */
            width: 500px;
            height: 300px;
            border: 5px solid red;
            background-image: url(img/mr.png);
            /*设置背景图不允许重复*/
            background-repeat: no-repeat;
            background-position: 0 0;/*默认位置在左上角*/
            background-position: -50px 0;/*向左*/
            background-position: 0px 50px;/*向下*/
            background-position: -50px -50px;/*向左上*/
            background-position: 50% 50%;
            background-position: 100% 100%;
            background-position: left top;
            background-position: right bottom;
            background-position: center center;
            background-position: center;
        }
        .d3 {
            width: 500px;
            height: 300px;
            /*渐变色 角度值(deg) 颜色1 颜色2...*/
            background-image: linear-gradient(30deg,#f00,orange,green,blue,purple);
        }
    </style>
</head>
<body>
    <h1>测试颜色</h1>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="d3"></div>
</body>
</html>